package com.adream.cliniq.server.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.adream.cliniq.domain.Person;

public class PersonDao {
    private HibernateTemplate hibernateTemplate;

    public void setSessionFactory(SessionFactory sessionFactory) {
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    public void savePerson(Person person) {
        this.hibernateTemplate.save(person);
    }

    public List listPeople() {
        List people = this.hibernateTemplate.loadAll(Person.class);
        return people;
    }
}
